/**   
 * @Title: Type.java
 * @Package com.cityoneyes.bean
 * @Description: TODO
 * @author Rick
 * @date 2011-7-31 下午11:41:16
 * @version V1.0   
 */
package com.cityoneyes.bean;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * @ClassName: Type
 * @Description: 类型实体BEAN
 * @author Rick
 * @date 2011-7-31 下午11:41:16
 */
@Entity
@Table(name="e_type")
public class Type implements Serializable {

	private static final long serialVersionUID = -971578854019393276L;

	@Id 
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="id")
	private int id;
	@Column(name="code")
	private String code;
	@ManyToOne(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
	@JoinColumn(name = "id", insertable = false, updatable = false)
	private Type pType;
	@OneToMany(mappedBy="pType")
	private List<Type> subTypes;
	@Column(name="name")
	private String name;
	@Column(name="search_count")
	private int searchCount;
	@Column(name="order_index")
	private int orderIndex;
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public Type getpType() {
		return pType;
	}
	public void setpType(Type pType) {
		this.pType = pType;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getSearchCount() {
		return searchCount;
	}
	public void setSearchCount(int searchCount) {
		this.searchCount = searchCount;
	}
	public int getOrderIndex() {
		return orderIndex;
	}
	public void setOrderIndex(int orderIndex) {
		this.orderIndex = orderIndex;
	}
	public List<Type> getSubTypes() {
		return subTypes;
	}
	public void setSubTypes(List<Type> subTypes) {
		this.subTypes = subTypes;
	}
}
